﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace EmailClient
{
    public partial class TeachFilterSpam : Form
    {
        public string emailAddress = "";
        public TeachFilterSpam(string emailAddress)
        {
            InitializeComponent();
            this.emailAddress = emailAddress;
        }

        private void TeachFilterSpam_Load(object sender, EventArgs e)
        {
            txt_LocationFolderSpam.Text = @"EmailDB\Spam";
            txt_LocationFolderNotSpam.Text = @"EmailDB\NotSpam";
        }

        private void btn_GetLocaltionFolderSpam_Click(object sender, EventArgs e)
        {
            DialogResult result = folderBrowserDialogLocation.ShowDialog();
            if (result.CompareTo(DialogResult.OK)==0)
            {
                string path = folderBrowserDialogLocation.SelectedPath;
                txt_LocationFolderSpam.Text = @path;
 
            }
        }

        private void btn_GetLocationFolderNotSpam_Click(object sender, EventArgs e)
        {
            DialogResult result = folderBrowserDialogLocation.ShowDialog();
            if (result.CompareTo(DialogResult.OK) == 0)
            {
                string path = folderBrowserDialogLocation.SelectedPath;
                txt_LocationFolderNotSpam.Text = @path;
            }
        }

        private void btn_Cancel_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void btn_TeachFilterSpam_Click(object sender, EventArgs e)
        {
            //teach spam
            FormMain.naiveBayes.TeachFilterSpam(txt_LocationFolderSpam.Text, txt_LocationFolderNotSpam.Text, FormMain.emailReader);

        }
    }
}
